home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / sharewar / FFE / MISC.SWG / 0013_Animated Cursor Format.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  2KB  |  55 lines

  1. From robertjh@awod.com Fri Aug 30 19:18:26 1996
  2. To: "'paul@wotsit.demon.co.uk'" <paul@wotsit.demon.co.uk>
  3. Subject: ANI (Windows95 Animated Cursor File Format)
  4. Date: Thu, 29 Aug 1996 21:52:01 -0400
  5.  
  6. ANI (Windows95 Animated Cursor File Format)
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8.  
  9. This is a paraphrase of the format.  It is essetially just a RIFF file =
  10. with extensions... (view this monospaced)
  11. This info basically comes from the MMDK (Multimedia DevKit).  I don't =
  12. have it in front of me, so I'm going backwards from a VB program I wrote =
  13. to decode .ANI files.
  14.  
  15. "RIFF" {Length of File}
  16.     "ACON"
  17.         "LIST" {Length of List}
  18.             "INAM" {Length of Title} {Data}
  19.             "IART" {Length of Author} {Data}
  20.         "fram"
  21.             "icon" {Length of Icon} {Data}      ; 1st in list
  22.             ...
  23.             "icon" {Length of Icon} {Data}      ; Last in list  (1 to cFrames)
  24.     "anih" {Length of ANI header (36 bytes)} {Data}   ; (see ANI Header TypeDef )
  25.     "rate" {Length of rate block} {Data}      ; ea. rate is a long (length is 1 to cSteps)
  26.     "seq " {Length of sequence block} {Data} ; ea. seq is a long (length is 1 to cSteps)
  27.  
  28. -END-
  29.  
  30.  - Any of the blocks ("ACON", "anih", "rate", or "seq ") can appear in any 
  31. order.  I've never seen "rate" or "seq " appear before "anih", though.  You
  32. need the cSteps value from "anih" to read "rate" and "seq ".  The order I 
  33. usually see the frames is: "RIFF", "ACON", "LIST", "INAM", "IART", "anih",
  34. "rate", "seq ", "LIST", "ICON".  You can see the "LIST" tag is repeated and
  35. the "ICON" tag is repeated once for every embedded icon.  The data pulled 
  36. from the "ICON" tag is always in the standard 766-byte .ico file format.
  37.  
  38.  - All {Length of...} are 4byte DWORDs.
  39.  
  40.  - ANI Header TypeDef:
  41.  
  42. struct tagANIHeader {
  43.     DWORD cbSizeOf; // Num bytes in AniHeader (36 bytes)
  44.     DWORD cFrames; // Number of unique Icons in this cursor
  45.     DWORD cSteps; // Number of Blits before the animation cycles
  46.     DWORD cx, cy; // reserved, must be zero.
  47.     DWORD cBitCount, cPlanes; // reserved, must be zero.
  48.     DWORD JifRate; // Default Jiffies (1/60th of a second) if rate chunk not present.
  49.     DWORD flags; // Animation Flag (see AF_ constants)
  50.     } ANIHeader;
  51.  
  52. #define AF_ICON =3D 0x0001L // Windows format icon/cursor animation
  53.  
  54.  
  55. R. James Houghtaling